#include "buffer.h"

obj::buffer::buffer(unsigned buffersize) : buf(buffersize, 0), cursor(0), length(0), buffersize(buffersize) {

}

void obj::buffer::increase(unsigned n) {
    buf.reserve(buf.size() + n);
    buf.resize(buf.size() + n, 0);
}

void obj::buffer::increase() {
    increase(buffersize);
}

char obj::buffer::next() {
    return buf[cursor++];
}
